In [12]:
import time
import sys
from bio2bel_mirtarbase import Manager
from pybel import BELGraph
from pybel.dsl import *
from pybel_tools.visualization import to_jupyter
In [13]:
print(sys.version)
In [10]:
time.asctime()
Out[10]:
Like all Bio2BEL packages that handle databases, there is a class Manager available from the top-level of the package that makes very sensible defaults for where to store the data and load connection configuration for more advanced users.
In [2]:
manager = Manager()
A simple graph is constructed with two RNA nodes. In general, inferring the central dogma on a graph that contains many proteins could provide additonal insight in case their corresponding RNAs are not included.
In [3]:
graph = BELGraph()
graph.add_node_from_data(rna(namespace='HGNC', name='APP'))
graph.add_node_from_data(rna(namespace='HGNC', name='DDX21'))
Out[3]:
The function Manager.enrich_rnas gets all RNA nodes and adds their miRNA controllers.
In [4]:
%%time
manager.enrich_rnas(graph)
In [5]:
to_jupyter(graph)
Out[5]:
In [6]:
graph = BELGraph()
graph.add_node_from_data(mirna(namespace='MIRTARBASE', name='hsa-miR-16-5p'))
graph.add_node_from_data(mirna(namespace='MIRTARBASE', name='hsa-miR-548e-3p'))
Out[6]:
The function Manager.enrich_mirnas gets all miRNA nodes and adds their RNA targets. Because this sometimes results in incredibly large numbers of connections being added, future improvements will allow for selection of the least promiscuous targets and highest confidence interactions based on their experiments.
In [7]:
%%time
manager.enrich_mirnas(graph)
In [8]:
to_jupyter(graph)
Out[8]: